import { useVModel } from '../../../utils/hooks'
import { defineComponent } from 'vue'
import { Switch } from 'ant-design-vue'

export default defineComponent({
  name: 'SpsSwitch',
  props: {
    value: {
      type: [String, Number, Boolean]
    }
  },
  setup(props, { attrs, emit }) {
    const checked = useVModel(props, 'value', emit)
    /* render 函数 */
    return () => {
      return <Switch v-model:checked={checked.value} {...attrs} />
    }
  }
})
